cmake_minimum_required(VERSION 2.8)
project(ipc-bench C)

add_compile_options(-Wall -Wextra -Wpedantic)

add_executable(pipe_lat src/pipe_lat.c)
add_executable(pipe_thr src/pipe_thr.c)
add_executable(tcp_lat src/tcp_lat.c)
add_executable(tcp_local_lat src/tcp_local_lat.c)
add_executable(tcp_remote_lat src/tcp_remote_lat.c)
add_executable(tcp_thr src/tcp_thr.c)
add_executable(udp_lat src/udp_lat.c)
add_executable(unix_lat src/unix_lat.c)
add_executable(unix_thr src/unix_thr.c)


IF (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
target_link_libraries(pipe_lat   socket)
target_link_libraries(pipe_thr   socket)
target_link_libraries(tcp_lat   socket)
target_link_libraries(tcp_local_lat   socket)
target_link_libraries(tcp_remote_lat   socket)
target_link_libraries(tcp_thr   socket)
target_link_libraries(udp_lat   socket)
target_link_libraries(unix_lat   socket)
target_link_libraries(unix_thr   socket)
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "QNX")

